/**
 * Created by yoyoyk on 2017/7/17.
 */
import React from 'react';
import {Select,DatePicker} from 'antd';
import {Input} from 'fly';

const Option = Select.Option;
export default function Header (props){

    const {
        orderList,
        orderGoodss,
        orderListStyNoChange,
        contractNumber
    } = props;

    let containerOrder;

    let containerStyleNo;

    return (<div className="create_Production_header">
            <div className="create_Production_headerItem" data-necessary="true" ref={(ref)=>{ containerOrder = ref; }}>
                <span data-type="title"> 订单 :</span>
                <Select
                    style={{ width: 180}}
                    onSelect={(e)=>{orderListStyNoChange("order",e,orderList)}}
                    getPopupContainer={()=>containerOrder}
                >
                    {
                        orderList.map((i)=>{
                               return <Option key={i.oid} value={i.oid}>{i.oid}</Option>
                        })
                    }
                </Select>
            </div>

            <div className="create_Production_headerItem" data-necessary="true"
                  style={{ paddingLeft: 75,marginRight:100}}
                  ref={(ref)=>containerStyleNo = ref}
            >
                <span data-type="title"> 款号 :</span>
                <Select
                    style={{ width: 180 }}
                    value={props.styleNoActive}
                    onSelect={(e)=>{orderListStyNoChange("styleNo",e,orderGoodss)}}
                    getPopupContainer={()=>containerStyleNo}
                >
                    {
                        orderGoodss.map((i,index)=>
                            <Option key={`styleNo-${index}`} value={i.styleNo}>{i.styleNo}</Option>
                        )
                    }
                </Select>
            </div>
            <div className="create_Production_headerItem" data-necessary="false">
                <span data-type="title">合同数量 {contractNumber}</span>
            </div>
            { props.children }
        </div>
    )
}